﻿using FluentNHibernate.Mapping;
using ScoutersLog.Model;

namespace ScoutersLog.DataAccess.Mappings
{
    public class UnitTypeMap : ClassMap<UnitType>
    {
        public UnitTypeMap()
        {
            // ReSharper disable DoNotCallOverridableMethodsInConstructor
            //   Required for O/R mapping
            Id(x => x.Id)
                .Column("unit_type_code")
                .GeneratedBy.Assigned();
            // ReSharper restore DoNotCallOverridableMethodsInConstructor
            Map(x => x.Name)
                .Column("unit_type_name")
                .Length(10);
            Map(x => x.FullName)
                .Column("unit_type_full_name")
                .Length(30);
        }
    }
}
